/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gr.uop.cst.context.base;

import java.io.Serializable;
import java.util.UUID;

/**
 *
 * @author Ioannis Bourlakos &lt;mi49@uop.gr&gt;
 */
public abstract class ContextSource<T> implements Serializable {

    // TODO: define uuid policy
    private final UUID uuid;
    
    public ContextSource() {
        this.uuid = UUID.randomUUID();
    }
    
    public abstract T getValue();
    public abstract float getConfidence();
    public abstract int getMinimumRefreshPeriod();
    public abstract boolean isAvailable();
    
    public UUID getUuid() {
        return this.uuid;
    }    
    
    @Override
    public String toString() {
        StringBuilder strBuf = new StringBuilder();
        strBuf.append(this.getClass().getCanonicalName());
        strBuf.append(':');
        strBuf.append(this.uuid.toString());
        return strBuf.toString();
    }
    
}
